package expressions.slogo;

import java.util.List;
import parsing.Separates;
import parsing.Token;

/**
 * Adds two values.
 */
@Token(regex = "\\+")
@Separates
public class Add extends expressions.Operator<Double>
{
    public Add()
    {
        super(2);
    }

    @Override
    public int priority()
    {
        return Priority.ARITHMETIC.adjust(Modifier.LOWEST);
    }

    @Override
    protected Double combineResults(List<Double> results)
    {
        return results.get(0) + results.get(1);
    }
}
